<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
	<%@ include file="/jsp/fragments/include.jsp" %>
	<title>Abel Personnel - Personnel Application - Register Account</title>
	<meta charset="utf-8"/>
	<meta name="description" CONTENT="Abel Personnel application"/>
	<meta name="keywords" CONTENT="Abel, Abel Personnel, Personnel, Personnel Application, Temporary Job, Temporary, Consulting, Job, Harrisburg"/>
	
	<link type="text/css" href="jsp/lib/css/main.css" rel="stylesheet"/>
	

	<!--[if lt IE 8]>
		<link rel="stylesheet" type="text/css" media="all" href="jsp/lib/css/ie6.css"/>
	<![endif]-->
	
	<!--[if IE]>
		<link rel="stylesheet" type="text/css" media="all" href="jsp/lib/css/ie.css"/>
	<![endif]-->
  
  <!-- BRAND CSS -->
	<link type="text/css" href="jsp/brand/abel/brand.css" rel="stylesheet"/>

</head>
<body class="register" id="index">
	
	<!-- HEADER -->
	<div id="header" class="body">
		<header class="body" id="banner">
			<h1><a href="#">Abel Personnel</a></h1>
			<div class="description"> 
	      Personal Touch -- Professional Quality
	      <br/> 
	      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"We stake our reputation on the people who work for you"
	    </div>
		</header>
	</div>
	
	<!-- CONTENT -->
	<div id="section" class="body">
		<section class="body" id="content">
			<c:if test="${registrationView.anyAdmin }">
				<div class="user">${registrationView.salutation} &nbsp;&nbsp; <span class="userLinks">[<a href="dashboard.xhtm">Admin Dashboard</a>] &nbsp; [<a href="logout.xhtm">Sign Out</a>]</span></div>
			</c:if>
			<!-- FEATURED AREA / BREADCRUMBS / PROGRESS -->
			<h2>Register an Account</h2>
			<p> 	
				<spring:hasBindErrors name="registrationView">
					<div class="error">
						<span class="errorHeading">Please correct the following error(s).</span>
		             	<ul>
			             	<c:forEach items="${errors.allErrors}" var="error">  
			                	<li><spring:message code="${error.code}" text="${error.defaultMessage}"/></li>  
			             	</c:forEach>
		             	</ul>  
		         	</div> 
		     	</spring:hasBindErrors>
			</p>
			<div class="text requiredfieldmessage">
				Items with an asterisk(<span class="req">*</span>) are required
			</div>
			<form:form method="post" commandName="registrationView">
				<div class="fieldset">
					<fieldset>
						<legend>Authentication Account Information</legend>
						<div class="columns-2">
						  <div class="column1 left">
						  	<label for="userName"><span class="req">*</span> Username:</label> 
						  </div>
						  <div class="column2">
						  	<form:input path="userName" size="20" cssClass="text" cssErrorClass="text errorfield"/>
						  </div>
					  </div>
					  <div class="columns-2">
						  <div class="column1 left">
					  		<label for="password"><span class="req">*</span> Password:</label>
						  </div>
						  <div class="column2">
							<form:password path="password" size="20" cssClass="text" cssErrorClass="text errorfield"/>
					  	</div>
					  </div>
					  <div class="columns-2">
						  <div class="column1 left">
					  		<label for="confirmPassword"><span class="req">*</span> Confirm Password:</label>
						  </div>
						  <div class="column2">
							<form:password path="confirmPassword" size="20" cssClass="text" cssErrorClass="text errorfield"/>
					  	</div>
					  </div>
					  <div class="columns-2">
						  <div class="column1 left">
					  		<label for="email"><span class="req">*</span> Email:</label>
						  </div>
						  <div class="column2">
								<form:input path="email" size="20" cssClass="text" cssErrorClass="text errorfield"/>
					  	</div>
					  </div>
					  <!-- BEGIN :: ONLY DISPLAYED IF SUPERUSER -->
					  <c:if test="${registrationView.superAdmin}">
						  <div class="columns-2">
							  <div class="column1 left">
						  		<label for="role"><span class="req">*</span> Role:</label>
							  </div>
							  <div class="column2">
									<select size="1" id="role" name="role">
										<option value="User">User</option>
										<option value="Administrator">Administrator</option>
										<option value="Superuser">Superuser</option>
									</select>
						  	</div>
						  </div>
					  </c:if>
					  <!-- END :: ONLY DISPLAYED IF SUPERUSER -->
					</fieldset>
				</div>
				<div class="formFooter">
				<c:choose>
					<c:when test="${registrationView.anyAdmin}">
						<input type="button" name="cancel" value="Cancel" class="button" onClick="javascript:location.href='dashboard.xhtm'"/> &nbsp;
					</c:when>
					<c:otherwise>
						<input type="button" name="cancel" value="Cancel" class="button" onClick="javascript:location.href='login.xhtm'"/> &nbsp;
					</c:otherwise>
				</c:choose>
				<input type="submit" name="register" value="Register" class="button"/>
				</div>
			</form:form>
			
		</section>
	</div>
	
	<!-- FOOTER -->
	<div id="footer">
		<footer id="contentinfo">
			<p class="copyright">&copy; <a href="http://www.abelpersonnel.com">Abel Personnel, Inc.</a>  All rights reserved</p>
		</footer>
	</div>

</body>
</html>